home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / include / pi-memo.hxx < prev    next >
Text File  |  1997-05-23  |  1KB  |  65 lines

  1.  
  2. #include "pi-appinfo.hxx"
  3.  
  4. const int MEMO_APP_INFO_SIZE = BASE_APP_INFO_SIZE;
  5.  
  6. struct memoAppInfo_t : public appInfo_t 
  7. {
  8.      memoAppInfo_t(void *buffer) : appInfo_t(buffer) { }
  9.      
  10.      void *pack(void) 
  11.      {
  12.       unsigned char *ret = new unsigned char [MEMO_APP_INFO_SIZE];
  13.       baseAppInfoPack(ret);
  14.       return ret;
  15.      }
  16. };
  17.  
  18. class memoList_t;        // Forward declaration for older compilers
  19.  
  20. class memo_t : public baseApp_t
  21. {
  22.      friend memoList_t;
  23.      
  24.      char *_text;
  25.      int _size;
  26.      
  27.      memo_t *_next;
  28.       
  29.      void *internalPack(unsigned char *);
  30.  
  31.    public:
  32.      memo_t(void) : baseApp_t() { _text = NULL; _size = 0; }
  33.      memo_t(void *buf) : baseApp_t() { unpack(buf, 1); }
  34.      memo_t(void *buf, int attr, recordid_t id, int category)
  35.       : baseApp_t(attr, id, category)
  36.      {
  37.            unpack(buf, 1);
  38.      }
  39.      memo_t(const memo_t &);
  40.  
  41.      void unpack(void *, int = 0);
  42.      ~memo_t() { if (_text) delete _text; }
  43.  
  44.      void *pack(int *i);
  45.      void *pack(void *, int *);
  46.  
  47.      const char *text(void) const { return _text; }
  48. };
  49.  
  50. class memoList_t 
  51. {
  52.      memo_t *_head;
  53.      
  54.    public:
  55.      memoList_t(void) : _head(NULL) { }
  56.      ~memoList_t();
  57.      
  58.      memo_t *first() { return _head; }
  59.      memo_t *next(memo_t *ptr) { return ptr->_next; }
  60.  
  61.      void merge(memo_t &);
  62.      void merge(memoList_t &);
  63. };
  64.      
  65.